require 'config/environment'

task :remove_pos_tag do
  raise "IO Error: Please specify csv filename (UTF-8)" unless ENV.has_key? "doc"
  raise "IO Error: Please specify output filename" unless ENV.has_key? "out"
  out = File.open(ENV["out"],"w")
  File.open(ENV["doc"],"r") do |file|
    flag = false
    while line = file.gets
      line.chomp!
      if /&lt;.?POS.?&gt;/ =~ line
        flag = flag ? false : true
      else
        out.puts line unless flag
      end
    end
  end
  out.close
end